<template>
  <div class="height-100">
    <div v-if="dataBool" :id="id" style="width:100%;height:100%"></div>
  </div>

</template>
<script>
// import { getPublicIndicatorStatistics } from '@/api/manage/leadCockpit/index'
import * as echarts from 'echarts'
export default {
  props: {
    id: String
  },
  data() {
    return {
      dataBool: false
    }
  },
  mounted() {
  },
  methods: {
    initECharts(data, color) {
      this.myCharts = echarts.init(document.getElementById(this.id))
      this.option = {
        color: color,
        series: [
          {
            name: '项目情况统计',
            type: 'pie',
            radius: ['70%', '90%'],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 2,
              borderColor: '#fff',
              borderWidth: 2
            },
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: false,
                fontSize: 40,
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
            data: data.dataSeries
          }
        ]
      }
      this.myCharts.setOption(this.option, true)
      window.addEventListener('resize', () => {
        this.myCharts.resize()
      })
    }

  }
}
</script>
<style>
</style>
